#ifndef  STR_H
#define  STR_H

#include <stddef.h>

/*note:1.it's the cstr ;
 *     2.can include the zero in the middle of the cstr
*      3.import an easy way to use the cstr & char array
*/

typedef struct str_s str_t;

void str_destroy(str_t * ptr);
str_t * str_create_from_cstr(const char * str);
str_t * str_create_from_array(char * array, size_t capacity, size_t len);
str_t * str_create_as_zero_array(size_t len);

size_t str_length(const str_t * ptr);
int str_set_length(str_t * ptr, size_t len);
const size_t str_capacity(const str_t * ptr);

const char * str_const_data(const str_t * ptr);
char * str_data(str_t * ptr);

//SMELL : maybe divergent changes
int str_print(const str_t * ptr);
int str_println(const str_t * ptr);

#endif   /* STR_H */
